<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<title>登录页</title>
<link rel="stylesheet" href="/mobile/Public/mobile/css/bootstrap.min.css">
<link rel="stylesheet" href="/mobile/Public/mobile/css/sty.css">
</head>
<body>
<div class="registerBg"> 
    <!---container-->
    <div class="container">
      <form id="form" action="" method="post">
      <div class="photograph"> 
        <span><img src="/mobile/Public/mobile/images/guohui.png" alt="国徽" class="photographImg"></span>
      </div>
      <h3 class="xTitle" style="color:red">平罗县人民法院绩效考核系统</h3>
       <div class="xGroup">
          <div class="xinput-group"> 
              <span class="xinput-group-addon"><img alt="登录" src="/mobile/Public/mobile/images/account.png"></span>
              <input id="account" type="text" class="xform-control xUserName" name="account" placeholder="请输入用户名">
          </div>
          <div class="xinput-group"> 
              <span class="xinput-group-addon"><img alt="密码" src="/mobile/Public/mobile/images/password.png"></span>
              <input id="password" type="password" class="xform-control xPsd" name="password" placeholder="请输入密码">
          </div>
        </div> 
        <div style="width: 70%;margin: 0 auto;">
          <span>
            <input type="checkbox" id="xRemember" checked="checked" style="margin: 0;">
              记住密码
          </span>
          <span style="float:right;">
            <input type="checkbox" id="xLogin" style="margin: 0;">
            自动登录
          </span>
        </div>
       <button type="button" class="xlogin" onclick="myFunction()">登录</button>
      </form>
    </div>
    <div id="pop2" class="cd-popup" role="alert">
        <div class="cd-popup-container">
            <div id="popicon"><span class="mui-icon mui-icon-close"></span></div>
            <div class="popcont" id="pop2Cont"></div>
        </div>
    </div>
  <!--container-->  
</div>
<script type="text/javascript" src="/mobile/Public/mobile/js/jquery-1.9.1.js"></script>
<script src="/mobile/Public/mobile/js/mui.min.js"></script>
<script type="text/javascript">
  mui.init();
</script>
<script type="text/javascript">
    function myFunction(){
      var account = $('#account').val();
      var password = $('#password').val();
      if(!account){
        mui.alert('请输入您的用户名！', '提醒：', function() {});
      }else if(!password){
        mui.alert('请输入您的密码！', '提醒：', function() {});
      }else{
        $.ajax({
          url: "<?php echo U('login/login');?>",
          type: 'post',
          data: {account:account,password:password},
          success:function(mes){
            if(mes == 3){
              alert('该用户不存在，请查证后输入！');
            }else if(mes == 4){
              alert('密码错误，请重新输入！');
            }else if(mes == 1){
              window.location.href = "<?php echo U('index/index');?>";
            }else if(mes == 0){
              window.location.href = "<?php echo U('login/reaccount');?>";
            }
          }
        });
      }
    }
    function ShowNotice(type, str) {
        if (type == "s")
            $("#popicon").innerHTML = "<span class='glyphicon glyphicon-remove-sign''></span>";
        else
            var abb= $("#popicon").html("<span class='glyphicon glyphicon-remove-sign''></span>");
            $('#pop2').addClass('is-visible');
            $("#pop2Cont").html(str);
            p2TM = setTimeout(function () { ClosePop("pop2"); }, 1200);
    }
    var p2TM = null;
    var p3TM = null;
    function ClosePop(pID) {
        $('#' + pID).removeClass('is-visible');

        if (pID == "pop2")
            clearTimeout(p2TM);
        else if (pID == "pop3")
            clearTimeout(p3TM);
    }
</script>
</body>
</html>